package com.lingyu.jsjx.service.impl;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.datascope.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lingyu.jsjx.mapper.CourseReformMapper;
import com.lingyu.jsjx.domain.CourseReform;
import com.lingyu.jsjx.service.ICourseReformService;

/**
 * 课程改革Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-08
 */
@Service
public class CourseReformServiceImpl  extends ServiceImpl<CourseReformMapper, CourseReform> implements ICourseReformService
{
    @Autowired
    private CourseReformMapper courseReformMapper;

    /**
     * 查询课程改革
     * 
     * @param reformId 课程改革主键
     * @return 课程改革
     */
    @Override
    public CourseReform selectCourseReformByReformId(Long reformId)
    {
        return courseReformMapper.selectCourseReformByReformId(reformId);
    }

    /**
     * 查询课程改革列表
     * 
     * @param courseReform 课程改革
     * @return 课程改革
     */
    @Override
    @DataScope(deptAlias = "u", userAlias = "cr",type = "jsjx")
    public List<CourseReform> selectCourseReformList(CourseReform courseReform)
    {
        return courseReformMapper.selectCourseReformList(courseReform);
    }

    /**
     * 新增课程改革
     * 
     * @param courseReform 课程改革
     * @return 结果
     */
    @Override
    public int insertCourseReform(CourseReform courseReform)
    {
        return baseMapper.insert(courseReform);
    }

    /**
     * 修改课程改革
     * 
     * @param courseReform 课程改革
     * @return 结果
     */
    @Override
    public int updateCourseReform(CourseReform courseReform)
    {

        return baseMapper.updateById(courseReform);
    }

    /**
     * 批量删除课程改革
     * 
     * @param reformIds 需要删除的课程改革主键
     * @return 结果
     */
    @Override
    public int deleteCourseReformByReformIds(Long[] reformIds)
    {
        return courseReformMapper.deleteCourseReformByReformIds(reformIds);
    }

    /**
     * 删除课程改革信息
     * 
     * @param reformId 课程改革主键
     * @return 结果
     */
    @Override
    public int deleteCourseReformByReformId(Long reformId)
    {
        return baseMapper.deleteById(reformId);
    }

    @Override
    public List<Map<String, Object>> selectCountByCollage() {
        return courseReformMapper.selectCountByCollage();
    }
}
